#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <iostream>
#include <QString>
#include <QSet>
#include <QTextStream>
#include <QFile>
#include <QDir>
#include <QFileInfo>
#include <QJsonDocument>
#include <QJsonParseError>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QJsonValueRef>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow {
 Q_OBJECT

 public:
  MainWindow(QWidget *parent = nullptr);
  ~MainWindow();

 private slots:
  void on_btn_generate_clicked();

 private:
  void parseObject(QJsonObject &jsonObject, const QString &structName, QString &outStructStr);
  void parseArray(QJsonArray &jsonArray, const QString &structName, QString &outStructStr);
  QString convertToUpperCamel(const QString &srcStr);
  QString getValidStructName(const QString &oldName);

 private:
  Ui::MainWindow *ui;
  QString m_integerValueType;
  QSet<QString> m_structNameList;//结构体名称列表
};
#endif // MAINWINDOW_H
